package com.gopay.common.constants.oldmermove;

/**
 * 老平台商户迁移开通交易是否生效枚举
 * 
 * @OldMerTranEffectStatus.java
 * @author zhangjunyu
 * @2014-9-19 上午10:34:25 www.gopay.com.cn Inc.All rights reserved.
 */
public enum OldMerTranEffectStatus {
	/**
	 * 未设置
	 */
	UN_SET(0),
	/**
	 * 已设置
	 */
	HAVE_SET(1),
	/**
	 * 已生效
	 */
	HAVE_EFFECT(2);

	public final Integer value;

	private OldMerTranEffectStatus(Integer value) {
		this.value = value;
	}
	
	/**
     * 根据枚举类型的字符串值 获取 相应的枚举变量
     */
    public static OldMerTranEffectStatus get(Integer val) {
    	OldMerTranEffectStatus[] cs = OldMerTranEffectStatus.class.getEnumConstants();
        for (OldMerTranEffectStatus c : cs) {
            if (c.value.intValue() == val.intValue()) {
            	return c;
			}
        }
        throw new RuntimeException(" wrong " + OldMerTranEffectStatus.class.getSimpleName() + " Integer code! " + val);
    }
}
